package com.spzx.feign.product;

import com.spzx.model.dto.product.SkuSaleDto;
import com.spzx.model.entity.product.ProductSku;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * service-product模块远程调用
 * <p>
 * Project: spzx-parent
 * Package: com.spzx.feign.product
 * Version: 1.0
 * <p>
 * Created by  wangjiaxin  on 2024/4/25 下午10:19
 */
@FeignClient(value = "service-product")
public interface ProductFeignClient {
    //根据skuId查询ProductSku
    @GetMapping("/api/product/getBySkuId/{skuId}")
    public abstract ProductSku getBySkuId(@PathVariable("skuId") Long skuId);

    //更新商品sku销量
    @PostMapping("/api/product/updateSkuSaleNum")
    Boolean updateSkuSaleNum(@RequestBody List<SkuSaleDto> skuSaleDtoList);
}
